package com.coocaa.typhoon.api.config.milvus;

import io.milvus.v2.client.ConnectConfig;
import io.milvus.v2.client.MilvusClientV2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author bijiahao
 * @date : 2025/6/10 15:26
 * @description
 */
@Configuration
public class MilvusConfig {
    @Autowired
    private MilvusConfigProperties milvusConfigProperties;

    @Bean
    public MilvusClientV2 milvusClientV2() {
        MilvusClientV2 client = new MilvusClientV2(ConnectConfig.builder()
                .uri(milvusConfigProperties.getUri())
                .token(milvusConfigProperties.getToken())
                .dbName(milvusConfigProperties.getDbName())
                .build());
        return client;
    }
}
